package com.kugong.util;

/**
 * Created by lenovo on 2015/8/7.
 */
public class NumberUtil {
    /**
     * 数字前补零
     * @author liuxin
     * @date 2015-8-7
     * @param num
     * @param length
     * @return String
     */
    public static String FormatNum(String num,int length){
        StringBuffer sb = new StringBuffer(length);
        sb.append(num);
        while (sb.length() < length) {
            sb.insert(0, 0);
        }
        return sb.toString();
    }
}
